<%-- 
    Document   : N950
    Created on : Oct 24, 2012, 4:07:06 PM
    Author     : Nguyen Hung
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            $j(document).ready(function(){
                $j('#items').easyPaginate({
                    step:1
                });
                $j('#itemss').easyPaginate({
                    step:1
                });
                var b = location.pathname;
                $j("input[id$='message']").val(b);
                
                $j(".saveN950").live("click",function(){
                     showPleaseWait();
                    nv952 = $j(this).parent(".popup-footer").parent(".groupcontact").parent(".itemcontent").find(".nv952").val();//dia chi
                    nv954 = $j(this).parent(".popup-footer").parent(".groupcontact").parent(".itemcontent").find(".nv954").val();
                    nv955 = $j(this).parent(".popup-footer").parent(".groupcontact").parent(".itemcontent").find(".nv955").val();
                    nv957 = $j(this).parent(".popup-footer").parent(".groupcontact").parent(".itemcontent").find(".nv957").val();
                    nv967 = $j(this).parent(".popup-footer").parent(".groupcontact").parent(".itemcontent").find(".nv967").val();
                    nv958 = $j(this).parent(".popup-footer").parent(".groupcontact").parent(".itemcontent").find(".nv958").val();
                    nv961 = $j(this).parent(".popup-footer").parent(".groupcontact").parent(".itemcontent").find(".nv961").val();
                    nv962 = $j(this).parent(".popup-footer").parent(".groupcontact").parent(".itemcontent").find(".nv962").val();
                    nv968 = $j(this).parent(".popup-footer").parent(".groupcontact").parent(".itemcontent").find(".nv968").val();
                    nv969 = $j(this).parent(".popup-footer").parent(".groupcontact").parent(".itemcontent").find(".nv969").val();
                    //  nv960 = $j(this).parent(".popup-footer").parent(".groupcontact").parent(".itemcontent").find(".nv960").val();//ghi chu
                    pn950 = $j(this).attr("lang");
                    fn100 = $j(this).parent(".popup-footer").attr("lang");
              
                     var table = $j('#N950FORM\\:table').val();
                     
                    $j.post("postN950Ajax.jsp?action=updateN950Ajax&nv952="+nv952+"&nv954="+nv954+"&nv955="+nv955+"&nv957="+nv957
                        +"&nv967="+nv967+"&nv958="+nv958+"&nv961="+nv961+"&nv968="+nv968+"&nv969="+nv969+"&pn950="+pn950+"&fn100="+fn100+"&nv962="+nv962+"&table="+table,function(data){
                        if(data != null){
                            $j(".mesage").text("Cập nhật thành công");
                            hidePleaseWait();
                        }
                    });
                });
                $j(".pageindex").live("click",function(){
                    $j(".mesage").text("");
                });
                $j(".saveN950aj").live("click",function(){
                    showPleaseWait();
                  
                });
            });
        </script>
        <style type="text/css">
            .message{
                color: red;
                float: left;
                text-align: center;
                margin-top: 16px;
                font-weight:bold;
            }
            a, a:visited{
                text-decoration:none;
                color:#06C;
            }
            a:hover{color:#999;}

            /* base */

            /* content */

            ul#items{		
                margin:0;
                height:120px;
                width:auto;
                overflow:hidden;
                list-style:none !important;
            }
            ul#items li{
                list-style:none !important;
                float:left;
                width:200px;
                height:120px;
                overflow:hidden;
                margin:0 0 0 1px;
                background:#999;
                color:#fff;
                text-align:center;
            }
            ol#pagination{overflow:hidden; margin: 2px;}
            ol#pagination li{
                border: 1px solid gray;
                cursor: pointer;
                float: left;
                height: 11px;
                list-style: none outside none !important;
                margin-left: 5px;
                padding: 2px 9px 5px;
                position: inherit;
                width: 5px;
            }
            ol#pagination li.current{color:#f00;font-weight:bold;}
            li {
                list-style:none !important;
            }
        </style>
    </head>
    <body>
        <f:view>
            <a4j:form id="N950FORM">
                <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
                <h:panelGroup rendered="#{contactController.render==0}">
                    <div style="float:left; width:50%;">
                        <div class="fields_input">
                            <label><h:outputText value="#{locale.address}"/>*:</label>                                                
                            <h:inputText value="#{contactController.nv952}" id="address" styleClass="required">
                            </h:inputText>
                        </div>
                        <div class="fields_input">
                            <label><h:outputText value="#{locale.ward}"/>:</label>
                            <h:inputText value="#{contactController.nv954}"/>
                        </div>
                        <div class="fields_input">
                            <label><h:outputText value="#{locale.district}"/>:</label>
                            <h:inputText value="#{contactController.nv955}"/>
                        </div>
                        <div class="fields_input">
                            <label><h:outputText value="#{locale.city}"/>:</label>
                            <h:inputText value="#{contactController.nv957}"/>
                        </div>
                        <div class="fields_input">
                            <label><h:outputText value="#{locale.email}"/>:</label>
                            <h:inputText value="#{contactController.nv967}" styleClass="email"/>
                        </div>
                    </div>
                    <div style="float:left; width:50%;">
                        <div class="fields_input">
                            <label><h:outputText value="#{locale.tel}"/>*:</label>
                            <h:inputText value="#{contactController.nv958}"  styleClass="number required" id="tel">
                            </h:inputText>
                        </div>
                        <div class="fields_input">
                            <label><h:outputText value="#{locale.mobile}"/>:</label>
                            <h:inputText value="#{contactController.nv962}"  styleClass="number" >

                            </h:inputText>
                        </div>
                        <div class="fields_input">
                            <label><h:outputText value="#{locale.fax}"/>: </label>
                            <h:inputText value="#{contactController.nv961}" styleClass="number" >
                            </h:inputText>

                        </div>
                        <div class="fields_input">
                            <label><h:outputText value="#{locale.skype}"/>:</label>
                            <h:inputText value="#{contactController.nv968}"></h:inputText>
                            </div>
                            <div class="fields_input">
                                <label><h:outputText value="#{locale.yahoo}"/>:</label>
                            <h:inputText value="#{contactController.nv969}"></h:inputText>         
                            </div> 

                        </div>
                    <h:panelGroup id="contact" >
                        <div class="popup-footer" style="margin-left: 0px;">

                            <h:outputText value="#{contactController.messageform}" id="mesage1111" styleClass="message"/>
                            <a4j:commandButton onclick="showPleaseWait();" reRender="mesage1111"
                                               oncomplete="hidePleaseWait();"  action="#{contactController.saveN950}" value="#{locale.save}" styleClass="buttonsave">
                                <f:param value="#{contactController.pn950}" name="pn950"></f:param>
                                <f:param value="#{contactController.fn100}" name="fn100"></f:param>  
                                <f:param value="#{contactController.pagereload}" name="page"></f:param> 
                            </a4j:commandButton>
                            <h:inputHidden value="#{contactController.pagereload}" id="pagereload"/>
                            <h:inputHidden value="#{contactController.pn950}" id="pn950"/>
                            <h:inputHidden value="#{contactController.fn100}" id="fn100"/>
                          
                            <h:inputHidden value="#{contactController.table1}" id="table1"/>
                            <h:inputHidden value="#{contactController.flagedit}" id="flagedit"/>
                        </div>
                    </h:panelGroup>
                </h:panelGroup>
                <h:panelGroup rendered="#{contactController.listAjaxN950Bean!= null}">
                    <div id="items">
                        <a4j:repeat  value="#{contactController.listAjaxN950Bean}" var="item">
                            <li>
                                <div class="itemcontent">
                                    <div style="float:left; width:50%;">
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.address}"/>*:</label>                                                
                                            <h:inputText value="#{item.str1}" id="address" styleClass="required nv952">
                                            </h:inputText>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.ward}"/>:</label>
                                            <h:inputText value="#{item.WARD}" styleClass="nv954"/>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.district}"/>:</label>
                                            <h:inputText value="#{item.DIST}" styleClass="nv955"/>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.city}"/>:</label>
                                            <h:inputText value="#{item.CITY}" styleClass="nv957"/>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.email}"/>:</label>
                                            <h:inputText value="#{item.EML1}" styleClass="email nv967"/>
                                        </div>
                                    </div>
                                    <div style="float:left; width:50%;">
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.tel}"/>*:</label>
                                            <h:inputText value="#{item.TEL1}"  styleClass="number required nv958" id="tel">
                                            </h:inputText>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.mobile}"/>:</label>
                                            <h:inputText value="#{item.MOB2}"  styleClass="number nv962" >

                                            </h:inputText>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.fax}"/>: </label>
                                            <h:inputText value="#{item.MOB1}" styleClass="number nv961" >
                                            </h:inputText>

                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.skype}"/>:</label>
                                            <h:inputText value="#{item.EML2}" styleClass="nv968"></h:inputText>
                                            </div>
                                            <div class="fields_input">
                                                <label><h:outputText value="#{locale.yahoo}"/>:</label>
                                            <h:inputText value="#{item.EML3}" styleClass="nv969"></h:inputText>         
                                            </div> 

                                        </div>
                                    <h:panelGroup id="contact" styleClass="groupcontact">
                                        <%--
                                        <div class="popup-footer" style="margin-left: 0px;">

                                        <h:outputText value="#{contactController.messageform}" id="mesage1111" styleClass="message"/>
                                        <a4j:commandButton onclick="showPleaseWait();" reRender="mesage1111"
                                                           oncomplete="hidePleaseWait();"  action="#{contactController.saveN950}" value="#{locale.save}" styleClass="buttonsave">
                                            <f:param value="#{contactController.pn950}" name="pn950"></f:param>
                                            <f:param value="#{contactController.fn100}" name="fn100"></f:param>  
                                            <f:param value="#{contactController.pagereload}" name="page"></f:param> 
                                        </a4j:commandButton>
                                        <h:inputHidden value="#{contactController.pagereload}" id="pagereload"/>
                                        <h:inputHidden value="#{contactController.pn950}" id="pn950"/>
                                        <h:inputHidden value="#{contactController.fn100}" id="fn100"/>
                                        <h:inputHidden value="#{contactController.table}" id="table"/>
                                        <h:inputHidden value="#{contactController.table1}" id="table1"/>
                                        <h:inputHidden value="#{contactController.flagedit}" id="flagedit"/>
                                    </div>--%>
                                        <div class="popup-footer" lang="<h:outputText value="#{contactController.fn100}" />">   

                                            <h:outputText value="#{contactController.messageform}" id="mesage" styleClass="mesage"/>
                                            <div  class="buttonsave saveN950" lang="<h:outputText value="#{item.ADRNO}"/>">
                                                <h:outputText value='#{locale.save}' style="float:left;margin-left: 22px;"/>
                                            </div>                        


                                        </div>
                                    </h:panelGroup>
                                </div>
                            </li>
                        </a4j:repeat>  
                    </div>

                </h:panelGroup>
                <h:panelGroup rendered="#{contactController.listAjaxK950VBean!= null}">
                    <div id="itemss">
                        <a4j:repeat  value="#{contactController.listAjaxK950VBean}" var="item">
                            <li>
                                <div class="itemcontent">
                                    <div style="float:left; width:50%;">
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.address}"/>*:</label>                                                
                                            <h:inputText value="#{item.str1}" id="address" styleClass="required nv952">
                                            </h:inputText>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.ward}"/>:</label>
                                            <h:inputText value="#{item.WARD}" styleClass="nv954"/>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.district}"/>:</label>
                                            <h:inputText value="#{item.DIST}" styleClass="nv955"/>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.city}"/>:</label>
                                            <h:inputText value="#{item.CITY}" styleClass="nv957"/>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.email}"/>:</label>
                                            <h:inputText value="#{item.EML1}" styleClass="email nv967"/>
                                        </div>
                                    </div>
                                    <div style="float:left; width:50%;">
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.tel}"/>*:</label>
                                            <h:inputText value="#{item.TEL1}"  styleClass="number required nv958" id="tel">
                                            </h:inputText>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.mobile}"/>:</label>
                                            <h:inputText value="#{item.MOB2}"  styleClass="number nv962" >

                                            </h:inputText>
                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.fax}"/>: </label>
                                            <h:inputText value="#{item.MOB1}" styleClass="number nv961" >
                                            </h:inputText>

                                        </div>
                                        <div class="fields_input">
                                            <label><h:outputText value="#{locale.skype}"/>:</label>
                                            <h:inputText value="#{item.EML2}" styleClass="nv968"></h:inputText>
                                            </div>
                                            <div class="fields_input">
                                                <label><h:outputText value="#{locale.yahoo}"/>:</label>
                                            <h:inputText value="#{item.EML3}" styleClass="nv969"></h:inputText>         
                                            </div> 

                                        </div>
                                    <h:panelGroup id="contact" styleClass="groupcontact">
                                        <%--
                                        <div class="popup-footer" style="margin-left: 0px;">

                                        <h:outputText value="#{contactController.messageform}" id="mesage1111" styleClass="message"/>
                                        <a4j:commandButton onclick="showPleaseWait();" reRender="mesage1111"
                                                           oncomplete="hidePleaseWait();"  action="#{contactController.saveN950}" value="#{locale.save}" styleClass="buttonsave">
                                            <f:param value="#{contactController.pn950}" name="pn950"></f:param>
                                            <f:param value="#{contactController.fn100}" name="fn100"></f:param>  
                                            <f:param value="#{contactController.pagereload}" name="page"></f:param> 
                                        </a4j:commandButton>
                                        <h:inputHidden value="#{contactController.pagereload}" id="pagereload"/>
                                        <h:inputHidden value="#{contactController.pn950}" id="pn950"/>
                                        <h:inputHidden value="#{contactController.fn100}" id="fn100"/>
                                        <h:inputHidden value="#{contactController.table}" id="table"/>
                                        <h:inputHidden value="#{contactController.table1}" id="table1"/>
                                        <h:inputHidden value="#{contactController.flagedit}" id="flagedit"/>
                                    </div>--%>
                                        <div class="popup-footer" lang="<h:outputText value="#{contactController.fn100}" />">   

                                            <h:outputText value="#{contactController.messageform}" id="mesage" styleClass="mesage"/>
                                            <div  class="buttonsave saveN950" lang="<h:outputText value="#{item.ADRNO}"/>">
                                                <h:outputText value='#{locale.save}' style="float:left;margin-left: 22px;"/>
                                            </div>                        


                                        </div>
                                    </h:panelGroup>
                                </div>
                            </li>
                        </a4j:repeat>  
                    </div>

                </h:panelGroup>
                <h:inputHidden value="#{contactController.table}" id="table"/>
                 

            </a4j:form>
        </f:view>


    </body>
</html>
